package ho2;

class Car {
	static String size;// 型号

	public void drive() {
		System.out.println("这是一辆车");
	}
}

class Motor_Cycle extends Car {

	public void drive() {
		System.out.println("这是一辆摩托车，");
		System.out.println("ta的型号是" + size);
	}
}

class Hand_Tractor extends Car {

	public void drive() {
		System.out.println("这是一辆手扶拖拉机，");
		System.out.println("ta的型号是" + size);
	}
}

class Compact_Car extends Car {

	public void drive() {
		System.out.println("这是一辆小型汽车，");
		System.out.println("ta的型号是" + size);
	}
}

public class ho2 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Motor_Cycle c1 = new Motor_Cycle();// 分别创造一个实例
		c1.size = "sp7-motor";
		c1.drive();

		Hand_Tractor c2 = new Hand_Tractor();
		c2.size = "x511-tractor";
		c2.drive();

		Compact_Car c3 = new Compact_Car();
		c3.size = "Aodi-kk5x";
		c3.drive();

	}

}